package com.zrrd.yunchmall.user.mapper;

import com.zrrd.yunchmall.user.entity.Menu;
import com.zrrd.yunchmall.user.entity.Resource;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * <p>
 * 后台资源表 Mapper 接口
 * </p>
 *
 * @author YeKong
 * @since 2024-01-15
 */
@Mapper
public interface ResourceMapper extends BaseMapper<Resource> {

    @Select("SELECT * FROM ums_resource WHERE id IN " +
            "(SELECT resource_id FROM ums_role_resource_relation WHERE role_id=#{roleId})")
    List<Resource> selectResourceByRoleId(@Param(("roleId")) long roleId);

}
